package Observer.aboutjavautilobserve;

import java.util.Observable;

/**
 * @version : 1.0
 * @author: pengzx
 * @Description:
 * @date: 10:13 2017/11/10
 */
public class WeatherData extends Observable {

    private float temp;
    private float humidity;
    private float pressure;


    public void measurementsChanged(){
        setChanged();
        notifyObservers();
    }

    public void setMeasurement(float temp,float humidity,float pressure){
        this.temp = temp;
        this.humidity = humidity;
        this.pressure = pressure;
        measurementsChanged();
    }

    public WeatherData()
    {
    }

    public float getTemp()
    {
        return temp;
    }

    public void setTemp(float temp)
    {
        this.temp = temp;
    }

    public float getHumidity()
    {
        return humidity;
    }

    public void setHumidity(float humidity)
    {
        this.humidity = humidity;
    }

    public float getPressure()
    {
        return pressure;
    }

    public void setPressure(float pressure)
    {
        this.pressure = pressure;
    }
}
